package org.example.autofilearchiver.Web.Controller;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.example.autofilearchiver.tool.StaticClass.DOCX.DocxStatic;
import org.example.autofilearchiver.tool.StaticClass.FILE.FileStatic;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/file")
@Api(tags = "文件相关接口")
public class FileController {
    @PostMapping("/postPackeage/packeagePath")
    @ApiOperation(value = "文件夹的传入接口", notes = "传入一个文件夹路径，作为归档的文件夹模板")
    public String packagePath(@RequestBody String packagePath) {
        //接受到归档模板，存到全局
        System.out.println("Received 归档模板 package file path: " + packagePath);
        FileStatic.archivePackagePath=packagePath;//把路径存到全局数据里
        // 返回一个简单的响应，表示文件路径已收到
        return "Received 归档模板 path: " + packagePath;
    }
    @PostMapping("/postPackeage/outPackeagePath")
    @ApiOperation(value = "文件的输出结果文件夹", notes = "传入一个文件夹路径，作为输出结果文件夹")
    public String outPackagePath(@RequestBody String packagePath) {
        //接受到文件夹路径，存到全局
        System.out.println("Received 输出文件夹 package file path: " + packagePath);
        FileStatic.outPackagePath=packagePath;//把路径存到全局数据里
        // 返回一个简单的响应，表示文件路径已收到
        return "Received 输出文件夹 path: " + packagePath;
    }
}
